package com.yzy.soft.common.persistence.model;

import com.alibaba.fastjson.annotation.JSONField;
import com.alibaba.fastjson.annotation.JSONType;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.FieldFill;
import com.baomidou.mybatisplus.enums.IdType;
import com.yzy.soft.system.freemarker.html.TableButton;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;
import java.util.List;

@JSONType(orders={"elem","_id","url","page","loading","cellMinWidth","limits","limit","toolbar","defaultToolbar","cols"})
@TableName(value="html_table")
public class HtmlTable {
    @TableId(type= IdType.AUTO)
    @JSONField(serialize=false)
    private String id;
    @JSONField(serialize=false)
    private String var;
    @JSONField(serialize=false)
    private String name;
    @JSONField(ordinal=1)
    private String elem;
    @JSONField(ordinal=2,name="id")
    @TableField(value="id_tablein")
    private String idTablein;
    // 数据接口
    @JSONField(ordinal=3)
    private String url;
    // 开启分页
    @JSONField(ordinal=4)
    private boolean page=true;
    // 开启loading
    @JSONField(ordinal=5)
    private boolean loading=true;
    // 每列最小宽度
    @JSONField(ordinal=6)
    private Integer cellMinWidth=80;
    // 每页条数的选择项
    @JSONField(ordinal=7)
//    private Integer[] limits={10,15,30,50};
    private String limits="{10,15,30,50}";

    // 默认每页条数
    @JSONField(ordinal=8)
    private Integer limit=15;
    // 开启表格头部工具栏区域 该参数为 layui 2.4.0 开始新增。
    @JSONField(ordinal=9)
    private String toolbar="default";
    // 自由配置头部工具栏右侧的图标 该参数为 layui 2.4.1 新增
    @JSONField(ordinal=10)
//    private String[] defaultToolbar={"exports", "filter", "print"};
    private String defaultToolbar="{\"exports\", \"filter\", \"print\"}";
    @JSONField(serialize=false)
    @TableField(value="remarks")
    private String remarks;
    @TableField(value="code")
    @JSONField(serialize=false)
    private String code;

    @JSONField(serialize=false)
    @TableField(value="row_id")
    private String rowId;
    @JSONField(serialize=false)
    @TableField(value="html_id")
    private String htmlId;
    // 表头
    @JSONField(ordinal=11)
    @TableField(exist=false)
    private List<HtmlTableCol> cols;
    @TableField(exist=false)
    @JSONField(serialize=false)
    private List<TableButton> tableButton;

    private String description;
    /**
     *创建人
     */
    private String createperson;
    /**
     *修改人
     */
    private String makerperson;

    /**
     *创建时间
     */
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @TableField(value="createtime",fill= FieldFill.INSERT)
    private Date createtime;

    /**
     *最后一次修改时间
     */
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @TableField(value="lastupdatetime",fill= FieldFill.INSERT_UPDATE)
    private Date lastupdatetime;

    /**
     *创建目的
     */
    private String makegoal;

    /**
     *最后一次修改目的
     */
    private String lastupdategoal;

    /**
     *状态
     */
    private Integer userflag;

    /**
     *
     */
    private String deleteflag;

    /**
     *
     */
    private String spareflag1;

    /**
     *
     */
    private String spareflag2;

    /**
     *
     */
    private String spareflag3;

    /**
     *
     */
    private String spareflag4;

    /**
     *
     */
    private String spareflag5;

    /**
     *
     */
    private String sparefield1;

    /**
     *
     */
    private String sparefield2;

    /**
     *
     */
    private String sparefield3;

    /**
     *
     */
    private String sparefield4;

    /**
     *
     */
    private String sparefield5;

    /**
     *
     */
    private String sparefield6;

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getVar() {
        return var;
    }

    public void setVar(String var) {
        this.var = var;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getElem() {
        return elem;
    }

    public void setElem(String elem) {
        this.elem = elem;
    }



    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public boolean isPage() {
        return page;
    }

    public void setPage(boolean page) {
        this.page = page;
    }

    public boolean isLoading() {
        return loading;
    }

    public void setLoading(boolean loading) {
        this.loading = loading;
    }

    public Integer getCellMinWidth() {
        return cellMinWidth;
    }

    public void setCellMinWidth(Integer cellMinWidth) {
        this.cellMinWidth = cellMinWidth;
    }

    public String getLimits() {
        return limits;
    }

    public void setLimits(String limits) {
        this.limits = limits;
    }

    public Integer getLimit() {
        return limit;
    }

    public void setLimit(Integer limit) {
        this.limit = limit;
    }

    public String getToolbar() {
        return toolbar;
    }

    public void setToolbar(String toolbar) {
        this.toolbar = toolbar;
    }

    public String getDefaultToolbar() {
        return defaultToolbar;
    }

    public void setDefaultToolbar(String defaultToolbar) {
        this.defaultToolbar = defaultToolbar;
    }

    public String getRemarks() {
        return remarks;
    }

    public void setRemarks(String remarks) {
        this.remarks = remarks;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getHtmlId() {
        return htmlId;
    }

    public void setHtmlId(String htmlId) {
        this.htmlId = htmlId;
    }

    public List<HtmlTableCol> getCols() {
        return cols;
    }

    public void setCols(List<HtmlTableCol> cols) {
        this.cols = cols;
    }

    public List<TableButton> getTableButton() {
        return tableButton;
    }

    public void setTableButton(List<TableButton> tableButton) {
        this.tableButton = tableButton;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public String getCreateperson() {
        return createperson;
    }

    public void setCreateperson(String createperson) {
        this.createperson = createperson;
    }

    public String getMakerperson() {
        return makerperson;
    }

    public void setMakerperson(String makerperson) {
        this.makerperson = makerperson;
    }

    public Date getCreatetime() {
        return createtime;
    }

    public void setCreatetime(Date createtime) {
        this.createtime = createtime;
    }

    public Date getLastupdatetime() {
        return lastupdatetime;
    }

    public void setLastupdatetime(Date lastupdatetime) {
        this.lastupdatetime = lastupdatetime;
    }

    public String getMakegoal() {
        return makegoal;
    }

    public void setMakegoal(String makegoal) {
        this.makegoal = makegoal;
    }

    public String getLastupdategoal() {
        return lastupdategoal;
    }

    public void setLastupdategoal(String lastupdategoal) {
        this.lastupdategoal = lastupdategoal;
    }

    public Integer getUserflag() {
        return userflag;
    }

    public void setUserflag(Integer userflag) {
        this.userflag = userflag;
    }

    public String getDeleteflag() {
        return deleteflag;
    }

    public void setDeleteflag(String deleteflag) {
        this.deleteflag = deleteflag;
    }

    public String getSpareflag1() {
        return spareflag1;
    }

    public void setSpareflag1(String spareflag1) {
        this.spareflag1 = spareflag1;
    }

    public String getSpareflag2() {
        return spareflag2;
    }

    public void setSpareflag2(String spareflag2) {
        this.spareflag2 = spareflag2;
    }

    public String getSpareflag3() {
        return spareflag3;
    }

    public void setSpareflag3(String spareflag3) {
        this.spareflag3 = spareflag3;
    }

    public String getSpareflag4() {
        return spareflag4;
    }

    public void setSpareflag4(String spareflag4) {
        this.spareflag4 = spareflag4;
    }

    public String getSpareflag5() {
        return spareflag5;
    }

    public void setSpareflag5(String spareflag5) {
        this.spareflag5 = spareflag5;
    }

    public String getSparefield1() {
        return sparefield1;
    }

    public void setSparefield1(String sparefield1) {
        this.sparefield1 = sparefield1;
    }

    public String getSparefield2() {
        return sparefield2;
    }

    public void setSparefield2(String sparefield2) {
        this.sparefield2 = sparefield2;
    }

    public String getSparefield3() {
        return sparefield3;
    }

    public void setSparefield3(String sparefield3) {
        this.sparefield3 = sparefield3;
    }

    public String getSparefield4() {
        return sparefield4;
    }

    public void setSparefield4(String sparefield4) {
        this.sparefield4 = sparefield4;
    }

    public String getSparefield5() {
        return sparefield5;
    }

    public void setSparefield5(String sparefield5) {
        this.sparefield5 = sparefield5;
    }

    public String getSparefield6() {
        return sparefield6;
    }

    public void setSparefield6(String sparefield6) {
        this.sparefield6 = sparefield6;
    }

    public String getIdTablein() {
        return idTablein;
    }

    public void setIdTablein(String idTablein) {
        this.idTablein = idTablein;
    }

    public String getRowId() {
        return rowId;
    }

    public void setRowId(String rowId) {
        this.rowId = rowId;
    }

    @Override
    public String toString() {
        return "HtmlTable{" +
                "id='" + id + '\'' +
                ", var='" + var + '\'' +
                ", name='" + name + '\'' +
                ", elem='" + elem + '\'' +
                ", idTablein='" + idTablein + '\'' +
                ", url='" + url + '\'' +
                ", page=" + page +
                ", loading=" + loading +
                ", cellMinWidth=" + cellMinWidth +
                ", limits='" + limits + '\'' +
                ", limit=" + limit +
                ", toolbar='" + toolbar + '\'' +
                ", defaultToolbar='" + defaultToolbar + '\'' +
                ", remarks='" + remarks + '\'' +
                ", code='" + code + '\'' +
                ", rowId='" + rowId + '\'' +
                ", htmlId='" + htmlId + '\'' +
                ", cols=" + cols +
                ", tableButton=" + tableButton +
                ", description='" + description + '\'' +
                ", createperson='" + createperson + '\'' +
                ", makerperson='" + makerperson + '\'' +
                ", createtime=" + createtime +
                ", lastupdatetime=" + lastupdatetime +
                ", makegoal='" + makegoal + '\'' +
                ", lastupdategoal='" + lastupdategoal + '\'' +
                ", userflag=" + userflag +
                ", deleteflag='" + deleteflag + '\'' +
                ", spareflag1='" + spareflag1 + '\'' +
                ", spareflag2='" + spareflag2 + '\'' +
                ", spareflag3='" + spareflag3 + '\'' +
                ", spareflag4='" + spareflag4 + '\'' +
                ", spareflag5='" + spareflag5 + '\'' +
                ", sparefield1='" + sparefield1 + '\'' +
                ", sparefield2='" + sparefield2 + '\'' +
                ", sparefield3='" + sparefield3 + '\'' +
                ", sparefield4='" + sparefield4 + '\'' +
                ", sparefield5='" + sparefield5 + '\'' +
                ", sparefield6='" + sparefield6 + '\'' +
                '}';
    }
}
